home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 154 < prev    next >
Internet Message Format  |  1996-08-06  |  2KB

  1. Path: proffa.cc.tut.fi!k152608
  2. From: k152608@proffa.cc.tut.fi (Koivisto Hannu)
  3. Newsgroups: comp.std.c
  4. Subject: [Q] 16bit, 32bit, 64bit ints, longs etc.
  5. Date: 21 Jan 1996 14:00:48 GMT
  6. Organization: Prime Productions
  7. Distribution: world
  8. Message-ID: <4dtgug$5mf@cc.tut.fi>
  9. NNTP-Posting-Host: proffa.cc.tut.fi
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Heigh ho,
  13.  
  14. I know approximately what the current C standard says about this, and 
  15. I've heard that there is upcoming updates to the standard, which address 
  16. this issue. However, what I want to know is that what is "compiler 
  17. vendors' standard" on this. I've noted that
  18.  
  19. In most 16bit architectures, ints are 16bit, longs are 32bit.
  20. In most 32bit architectures, ints are 32bit, longs are 32bit.
  21.  
  22. Well, I don't care about 16bit systems, but what puzzles me is 32bit vs. 
  23. 64bit. You see, I thought that in 64bit systems ints would be 64bit and 
  24. longs 64bit. However, when I tried this with gcc running on an Alpha 
  25. machine, it turned out that ints are 32bit and longs are 64bit(of course, 
  26. pointers are also 64bit).
  27.  
  28. As I use Win32 API compatible types on all platforms, thought that when I 
  29. really want exactly 32bit I could use DWORD and when I want the 
  30. biggest/fastest integer I could use UINT. Of course, on ix86 platform 
  31. DWORD and UINT are equally fast, but as far as I know, on Alpha 
  32. machines(and most other 64bit architectures too) using anything but 64bit 
  33. ints is a bad thing. So, if I continued using UINT, it wouldn't be 
  34. optimal on 64bit architectures - I could use DWORD as well.
  35.  
  36. Well, I wrote my own types.h to address this issue, but I'd like to know 
  37. about conventions... Is it really so that in most 64bit architectures 
  38. ints are 32bit and longs are 64bit?
  39.  
  40.  
  41. Thanks in advance!
  42.  
  43. --
  44. Hannu "Azure" Koivisto | Saga microkernel, Prophet sub-system OS etc.
  45. Prime Productions      | developer. Software R&D + music.
  46. ---------------------------------------------------------------------
  47. What you see is all you get. -Brian Kernigham
  48.